<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .div1 {
      width: 100px;
      height: 100px;
      background-color: #56a5f1;
    }
  </style>
</head>
<body>
  <div id="app">
    <!-- @click.right是为了代替contextmenu -->
    <div
      class="div1"
      @click.left="left"
      @click.middle="middle"
      @click.right="right"
    ></div>
  </div>
  <script src="../vue.js"></script>
  <script>
    let vm = new Vue({
      el: '#app',
      data: {

      },
      methods: {
        left() {
          console.log('left');
        },
        right() {
          console.log('right');
        },
        middle() {
          console.log('middle');
        }
      },
    })
  </script>
</body>
</html>